package main

import "fmt"

/**
* @Author: super
* @Date: 2020-08-13 11:02
* @Description:
**/

func main() {
	var ar [3]int
	f(ar)   // passes a copy of ar
	fmt.Println("f",ar)
	fp(&ar) // passes a pointer to ar
	fmt.Println("fp", ar)
}

func f(a [3]int) {
	fmt.Println("f", a)
	a[1] = 2
	fmt.Println("f", a)
}

func fp(a *[3]int) {
	fmt.Println("fp", a)
	a[1] = 2
	fmt.Println("fp", a)
}
